import request from '@/utils/request'

const contract = {
  // 任务书列表
  list(params){
    return request.get(`/kjxm/project/contractList`,{params});
  },
  // 我的任务书列表
  myList(params){
    return request.get(`/kjxm/project/myContractList`,{params});
  },
  // 任务书添加
  add(data){
    return request.post('/kjxm/contract/add', data);
  },
  // 任务书修改
  update(data){
    return request.post('/kjxm/contract/update', data);
  },
  // 任务书获取
  get(id){
    return request.get(`/kjxm/contract/detail/${id}`);
  },
  // 任务书详情
  getAll(projectId){
    return request.get(`/kjxm/contract/allDetail/${projectId}`);
  },
  // 任务书项目id获取
  getByProject(projectId){
    return request.get(`/kjxm/contract/getByProjectId/${projectId}`);
  },
  // 新增项目研究主要目的和主要内容
  purposeContentAdd(data){
    return request.post('/kjxm/contractPurposeContent/add',data)
  },
  // 根据任务书id获取项目研究主要目的和主要内容
  purposeContentGet(contractId){
    return request.get(`/kjxm/contractPurposeContent/getByContractId/${contractId}`)
  },
  // 修改项目研究主要目的和主要内容
  purposeContentUpdate(data){
    return request.post('/kjxm/contractPurposeContent/update',data)
  },
  // 新增项目考核指标
  assessIndexAdd(data){
    return request.post('/kjxm/contractAssessIndex/add',data)
  },
  // 根据任务书id获取项目考核指
  assessIndexGet(contractId){
    return request.get(`/kjxm/contractAssessIndex/getByContractId/${contractId}`)
  },
  // 修改项目考核指
  assessIndexUpdate(data){
    return request.post('/kjxm/contractAssessIndex/update',data)
  },
  // 根据任务书id获取年度研究计划和目标
  researchPlanGetByContractId(contractId){
    return request.get(`/kjxm/contractResearchPlan/getByContractId/${contractId}`)
  },
  // 根据项目id获取年度研究计划和目标
  researchPlanGetByProjectId(ProjectId){
    return request.get(`/kjxm/contractResearchPlan/getByProjectId/${ProjectId}`)
  },
  // 新增项目年度研究计划和目标
  researchPlanAdd(data){
    return request.post(`/kjxm/contractResearchPlan/addList`, data)
  },
  // 新增项目成果及其形成的知识产权
  ResultsAdd(data){
    return request.post(`/kjxm/contractResults/add`, data)
  },
  // 修改项目成果及其形成的知识产权
  ResultsUpdate(data){
    return request.post(`/kjxm/contractResults/update`, data)
  },
  // 获取项目成果及其形成的知识产权
  ResultsGetByContractId(contractId){
    return request.get(`/kjxm/contractResults/getByContractId/${contractId}`)
  },
  // 根据项目id获取任务书条款
  termsGetByProjectId(ProjectId){
    return request.get(`/kjxm/contractTerms/getByProjectId/${ProjectId}`)
  },
  termsGetByContractId(ProjectId){
    return request.get(`/kjxm/contractTerms/getByContractId/${ProjectId}`)
  },
  // 新增项目任务书条款
  TermsAdd(data){
    return request.post(`/kjxm/contractTerms/addList`, data)
  },
  // 项目信息
  contractOthersAdd(data){
    return request.post(`/kjxm/contractOthers/add`, data)
  },
  contractOthersUpdate(data){
    return request.post(`/kjxm/contractOthers/update`, data)
  },
  contractOthersGetByContractId(id){
    return request.get(`/kjxm/contractOthers/getByContractId/${id}`)
  },
  contractOthersGetByProjectId(id){
    return request.get(`/kjxm/contractOthers/getByProjectId/${id}`)
  },
  projectContractExplainAdd(data){
    return request.post(`/kjxm/contractExplain/add`, data);
  },
  projectContractExplainUpdate(data){
    return request.post(`/kjxm/contractExplain/update`, data);
  },
  projectContractExplainGetByContractId(id){
    return request.get(`/kjxm/contractExplain/getByContractId/${id}`);
  },
  submit(data){
    return request.post('/kjxm/contract/submit', data);
  },
  oldSubmit(data){
    return request.post('/kjxm/contract/submitHistory', data);
  },
  createPDF(id,outType){
    return request.post(`/kjxm/contract/createPdfByWindows/${id}/${outType}`);
  },
  // 项目概况
  contractOverviewAdd(data) {
    return request.post('/kjxm/contractOverview/add', data);
  },
  contractOverviewUpdate(data) {
    return request.post('/kjxm/contractOverview/update', data);
  },
  contractOverviewGet(id){
    return request.get(`/kjxm/contractOverview/detail/${id}`);
  },
  getNewAll(projectId) {
    return request.get(`/kjxm/contract/newAllDetail/${projectId}`);
  },
}

export default contract;
